package io.framework.modules.air.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.framework.common.service.impl.CrudServiceImpl;
import io.framework.modules.air.dao.AirNdChangeDao;
import io.framework.modules.air.dto.AirNdChangeDTO;
import io.framework.modules.air.entity.AirNdChangeEntity;
import io.framework.modules.air.service.AirNdChangeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 城市浓度比较
 *
 * @author Gujq email
 * @since 1.0.0 2020-05-20
 */
@Service
public class AirNdChangeServiceImpl extends CrudServiceImpl<AirNdChangeDao, AirNdChangeEntity, AirNdChangeDTO> implements AirNdChangeService {

    @Override
    public QueryWrapper<AirNdChangeEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<AirNdChangeEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


    @Override
    public Boolean checkData(String month,Integer classify) {
        AirNdChangeEntity entity = baseDao.checkData(month,classify);
        Boolean flag = false ;
        if(entity != null){
            flag = true;
        }
        return flag;
    }
}